<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>MRtrix #VERSION# documentation</title>
<link rel="stylesheet" href="../stylesheet.css" type="text/css" media=screen>
</head>
<body>

<table class=nav>
  <tr>
    <td><a href="index.html"><img src="../left.png"></a></td>
    <td><a href="index.html"><img src="../up.png"></a></td>
    <td><a href="../index.html"><img src="../home.png"></a></td>
    <th>Importing DWI data</th>
    <td><a href="preprocess.html"><img src="../right.png"></a></td>
  </tr>
</table>

<h2><a name='dwi'>The diffusion-weighted images</a></h2>
<p>
White matter tractography relies on the appropriate diffusion-weighted data to infer fibre orientations 
(see e.g. <a href='../appendix/refs.html#mori'>Mori & van Zijl, 2002</a> for a review).
Diffusion tensor imaging requires a minimum of 7 images (1 <i>b</i>=0 &amp; 6 DWI) per imaging slice,
which are typically acquired using a <i>b</i>-value of approximately 1000 s/mm&sup2; 
(see e.g. <a href='../appendix/refs.html#basser'>Basser & Jones, 2002</a> for a review).
For spherical deconvolution, it is recommended to use 60 DW images or more and a <i>b</i>-value around 3000 s/mm&sup2;
(<a href='../appendix/refs.html#tournier1'>Tournier <i>et al.</i>. 2004</a>; 
<a href='../appendix/refs.html#tournier2'>Tournier <i>et al.</i> 2007</a>). 
</p>
<p>
The data can be supplied to MRtrix in any <a href='../general/formats.html'>supported image format</a>. 
Note that different image formats vary in their ability to carry additional information about the images.
In particular, DWI analysis will typically require the <em>DW scheme</em>, which contains the information
about the orientations of the various DW gradients used for the different images in the acquisition.
The only <a href='../general/formats.html'>supported image formats</a> that can carry this information 
are the <a href='../general/formats.html#DICOM'>DICOM</a> (tested with the Siemens diffusion package, on VB13 and above) 
and <a href='../general/formats.html#MRtrix'>MRtrix</a> formats.
It is however possible to use other image formats, in which case the DW scheme can be provided as a separate file (see <a href='#dwscheme'>below</a>).
</p>
<p>
If the DWI data are stored in <a href='../general/formats.html#DICOM'>DICOM</a> format, it is recommended to convert them
to <a href='../general/formats.html#MRtrix'>MRtrix</a> format, as this will speed up subsequent access.
</p>
<h3>Example:</h3>
<p>
Assuming the data are stored on CD (in the <kbd>/media/cdrom/4356307/</kbd> folder) in DICOM format, 
the <kbd><a href='../commands/mrconvert.html'>mrconvert</a></kbd> command can be used:
</p>
<pre>
&gt; <b><a href='../commands/mrconvert.html'>mrconvert</a> /media/cdrom/4356307/ dwi.mif</b>
<a href='../commands/mrconvert.html'>mrconvert</a>: scanning DICOM folder "/media/cdrom/4356307/"  - ok
Select series ('q' to abort):
   1 -    9 MR images 14:34:56 localiser (*fl2d1)
   2 -  192 MR images 14:46:55 t1_mpr_0.9 iso hres (*tfl3d1_ns)
   3 -   68 MR images 14:49:07 diff60_b3000_2.3_iPat2+ADC (*ep_b3000#5)
   4 -   54 MR images 14:56:45 diff60_b3000_2.3_iPat2+ADC_ADC (*ep_b0_3000)
   5 -  108 MR images 14:56:46 diff60_b3000_2.3_iPat2+ADC_TRACEW (*ep_b2950t)
   6 -   54 MR images 14:56:47 diff60_b3000_2.3_iPat2+ADC_FA (*ep_b0_3000)
   7 -   54 MR images 14:56:47 diff60_b3000_2.3_iPat2+ADC_ColFA (?)
? <b>3</b>
<a href='../commands/mrconvert.html'>mrconvert</a>: reading DICOM series "diff60_b3000_2.3_iPat2+ADC"... 100%
<a href='../commands/mrconvert.html'>mrconvert</a>: DICOM image contains mosaic files - reformating... 100%
<a href='../commands/mrconvert.html'>mrconvert</a>: copying data... 100%
</pre>
<p>
You can check that the data have been correctly converted using <kbd><a href='../commands/mrinfo.html'>mrinfo</a></kbd>:
</p>
<pre>
&gt; <b>mrinfo dwi.mif</b>
************************************************
Image:               "dwi.mif"
************************************************
  Format:            MRtrix
  Dimensions:        104 x 104 x 54 x 68
  Voxel size:        2.30769 x 2.30769 x 2.3 x 2.3
  Dimension labels:  0. left->right (mm)
                     1. posterior->anterior (mm)
                     2. inferior->superior (mm)
                     3. acquisition (?)
  Data type:         unsigned 16 bit integer (little endian)
  Data layout:       [ -0 -1 +2 +3 ]
  Data scaling:      offset = 0, multiplier = 1
  Comments:          VOLUNTEER (000366) [MR] diff60_b3000_2.3_iPat2+ADC
  Transform:             0.9998 5.181e-08  -0.01876    -114.8
                      -0.000815    0.9991  -0.04347    -101.9
                        0.01875   0.04347    0.9989    -48.98
                              0         0         0         1
  DW scheme:         68 x 4
</pre>
<p>
Notice the <em>DW scheme</em> entry for <kbd>dwi.mif</kbd>:
this indicates that the conversion found diffusion-encoding gradient information in the DICOM headers,
and successfully included this information in the header for the converted image.
This information is required for any type of DWI analysis. 
If this information was not found in the headers, it is still possible to provide it as a separate file
(see <a href='dwi.html#dwscheme'>here</a> for details).
</p>

<p class=sep><a href="#top">top</a></p>
<h2><a name='anat'>Anatomical images</a></h2>
<p>
It can also be useful to use a co-registered anatomical scan for display.
MRView can be used to identify particular anatomical landmarks, specify regions of interest more accurately, 
or display the tractography results on these images.
These images need to be coregistered with the DWI data set. 
If such an image was acquired at the same time as the DWI,
and assuming that the subject did not move between the scans, 
The <a href='../general/formats.html#DICOM'>DICOM</a> headers will contain all the information needed to re-align the two data sets.
</p>

<h3>Example:</h3>
<p>
The <a href='../general/formats.html#DICOM'>DICOM</a> folder used in the previous example contained a high-resolution T1 image.
It can be converted to <a href='../general/formats.html#MRtrix'>MRtrix</a> format using the following command:
</p>
<pre>
&gt; <b><a href='../commands/mrconvert.html'>mrconvert</a> /media/cdrom/4356307/ anat.mif</b>
<a href='../commands/mrconvert.html'>mrconvert</a>: scanning DICOM folder "/media/cdrom/4356307/"  - ok
Select series ('q' to abort):
   1 -    9 MR images 14:34:56 localiser (*fl2d1)
   2 -  192 MR images 14:46:55 t1_mpr_0.9 iso hres (*tfl3d1_ns)
   3 -   68 MR images 14:49:07 diff60_b3000_2.3_iPat2+ADC (*ep_b3000#5)
   4 -   54 MR images 14:56:45 diff60_b3000_2.3_iPat2+ADC_ADC (*ep_b0_3000)
   5 -  108 MR images 14:56:46 diff60_b3000_2.3_iPat2+ADC_TRACEW (*ep_b2950t)
   6 -   54 MR images 14:56:47 diff60_b3000_2.3_iPat2+ADC_FA (*ep_b0_3000)
   7 -   54 MR images 14:56:47 diff60_b3000_2.3_iPat2+ADC_ColFA (?)
? <b>2</b>
<a href='../commands/mrconvert.html'>mrconvert</a>: reading DICOM series "t1_mpr_0.9 iso hres"... 100%
<a href='../commands/mrconvert.html'>mrconvert</a>: copying data... 100%
</pre>

You can check that the data have been correctly converted using <kbd>mrinfo</kbd>:
</p>
<pre>
&gt; <b>mrinfo anat.mif</b>
************************************************
Image:               "anat.mif"
************************************************
  Format:            MRtrix
  Dimensions:        192 x 256 x 256
  Voxel size:        0.9 x 0.898438 x 0.898438
  Dimension labels:  0. inferior->superior (mm)
                     1. left->right (mm)
                     2. posterior->anterior (mm)
  Data type:         unsigned 16 bit integer (little endian)
  Data layout:       [ +2 -0 -1 ]
  Data scaling:      offset = 0, multiplier = 1
  Comments:          VOLUNTEER (000366) [MR] t1_mpr_0.9 iso hres
  Transform:              0.998  -0.05412  -0.03311    -74.03
                        0.05409    0.9985 -0.001794    -100.6
                        0.03316  2.34e-08    0.9995    -125.8
                              0         0         0         1
</pre>
<p>
As a final check, both sets of images can then be displayed using MRView:
</p>
<pre>
&gt; <b><a href='../commands/mrview.html'>mrview</a> dwi.mif anat.mif</b>
</pre>
<p>
This should open a window with both images loaded 
(you can swich between images using the Image menu - see <a href='../general/mrview.html'>here</a> for details):
</p>
<img src='dwi.png'>
<img src='anat.png'>



<p class=sep><a href="#top">top</a></p>
<h2><a name='dwscheme'>The diffusion-weighted gradient scheme</a></h2>
<p>
The DW scheme specifies the direction and <i>b</i>-value for each volumes of the DWI data set.
MRtrix will look for the DW scheme in the DW image header, otherwise this information will need to be supplied in a separate file.
This simple text file should contain a 4 &times; <i>N</i> matrix, where <i>N</i> is the number of volumes in the DWI data set.
Each line should consist of 4 numbers: the [ X Y Z ] components of the gradient direction, followed by the <i>b</i>-value.
Note that the magnitude of the direction vector is ignored.
Below is an example showing the DW scheme for a simple acquisition: 
1 <i>b</i>=0 image followed by 6 DW images with <i>b</i> = 1000 s/mm&sup2;:
</p>
<pre>
0  0  0  0
1  1  0  1000
1  0  1  1000
0  1  1  1000
1 -1  0  1000
1  0 -1  1000
0  1 -1  1000
</pre>
<p>
These directions should be provided with reference to the <a href='../general/overview.html#axes'>coordinate system</a> used by MRtrix. 
Note that this convention will most likely differ from the reference frame of the scanner. 
In this case, the gradient orientations specified in the pulse sequence will need to be adjusted accordingly.
Thankfully, in most cases it is simply a matter or inverting the components of one or more of the gradient orientation components.
</p>
<p>
It is also possible to extract the DW scheme from the image header (provided one is found).
This can be achieved by supplying the <kbd>-grad</kbd> option to <kbd><a href='../commands/mrinfo.html'>mrinfo</a></kbd>. For example:
</p>
<pre>
&gt; <b><a href='../commands/mrinfo.html'>mrinfo</a> /data/DICOM_folder/ -grad encoding.b</b>
</pre>
<p>
will scan the DICOM data set specified and store the DW scheme in the file <kbd>encoding.b</kbd> in the format described above.
</p>

<table class=nav>
  <tr>
    <td><a href="index.html"><img src="../left.png"></a></td>
    <td><a href="index.html"><img src="../up.png"></a></td>
    <td><a href="../index.html"><img src="../home.png"></a></td>
    <th><a href='#top'>top</a></th>
    <td><a href="preprocess.html"><img src="../right.png"></a></td>
  </tr>
</table>

<p class=footer>
Donald Tournier<br>
MRtrix version #VERSION#<br>
Last updated #MTIME#
</p>

</body>
</html>


